package com.qiaofang.mapper;

import com.qiaofang.common.model.PageDTO;
import com.qiaofang.dto.AdviserDTO;
import com.qiaofang.dto.PremisesDTO;
import com.qiaofang.dto.SmsHistoryDTO;
import com.qiaofang.entity.EstateAdviser;
import com.qiaofang.entity.Premises;
import com.qiaofang.entity.SmsHistory;
import io.swagger.annotations.Example;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.BaseMapper;
import tk.mybatis.mapper.common.ExampleMapper;

import java.util.List;

@Mapper
public interface PremisesMapper extends BaseMapper<Premises>, ExampleMapper<Premises> {

    @Select(value = "select p.id as id,p.name as name from tm_premises p where p.company_id = #{companyId}")
    List<Premises> selectIdListByCompanyId(Long companyId);

    Long listPremisesCount(@Param("premisesDto") PremisesDTO premisesDTO);

    List<Premises> listPremises(@Param("premisesDto") PremisesDTO premisesDTO, @Param("page") PageDTO page);

    /**
     * 刷新楼盘置业顾问关联的报备关系
     * @param adviserUuid
     * @param adviserUuidList
     */
    void refreshAdviser(@Param("adviserUuid")String adviserUuid, @Param("adviserUuidList")List<String> adviserUuidList);

    /**
     * 查询楼盘置业顾问
     * @param adviserDTO
     * @return
     */
    List<EstateAdviser> listAdviser(@Param("adviserDto")AdviserDTO adviserDTO);
}
